<%--
  Created by IntelliJ IDEA.
  User: 李林
  Date: 2020/2/22
  Time: 16:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="${pageContext.request.contextPath}/pages/img/user2-160x160.jpg" class="img-circle" alt="User Image">
            </div>
            <div class="pull-left info">
                <h4 class="h_username"><security:authentication property="principal.name"/></h4>
                <%--<a href="#"><i class="fa fa-circle text-success"></i> 在线</a>--%>
            </div>
        </div>
        <!-- search form -->
        <!--<form action="#" method="get" class="sidebar-form">
    <div class="input-group">
        <input type="text" name="q" class="form-control" placeholder="搜索...">
        <span class="input-group-btn">
        <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
        </button>
      </span>
    </div>
</form>-->
        <!-- /.search form -->

        <script>
            function loadcontent(url) {
                $.get(url,{},function (data) {
                    $(".onjsp").html(data);
                })
            }
        </script>

        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li class="header">菜单</li>

            <li id="admin-index"><a href="${pageContext.request.contextPath}/admin/main"><i class="fa fa-location-arrow"></i> <span>首页</span></a></li>

            <!-- 菜单 -->
            <li class="treeview">
                <a href="#">
                    <i class="fa fa-user"></i> <span>员工管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <security:authorize access="hasRole('ROLE_ADMIN')">
                    <li id="user-manager">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('user')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/user.jsp">
                            <i class="fa fa-circle-o"></i> 个人信息
                        </a>
                    </li>
                    <li id="user-modify">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('userupass')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/userupass.jsp">
                            <i class="fa fa-circle-o"></i> 修改密码

                        </a>
                    </li>
                    </security:authorize>
                    <security:authorize access="hasRole('ROLE_MANAGER')">
                    <li id="user-manager">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('user')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/user.jsp">
                            <i class="fa fa-circle-o"></i> 个人信息
                        </a>
                    </li>
                    <li id="user-modify">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('usershow')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/usershow.jsp">
                            <i class="fa fa-circle-o"></i> 员工信息
                        </a>
                    </li>
                    <li id="user-add">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('useradd')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/useradd.jsp">
                            <i class="fa fa-circle-o"></i> 添加员工
                        </a>
                    </li>
                    <li id="user-delete">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('user/userdelete')">--%>
                        <a href="${pageContext.request.contextPath}/admin/user/userdelete.jsp">
                            <i class="fa fa-circle-o"></i> 员工辞退
                        </a>
                    </li>
                    </security:authorize>
                </ul>
            </li>



            <li class="treeview">
                <a href="#">
                    <i class="fa fa-th-list"></i> <span>新闻管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li id="news-manager">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('news')">--%>
                        <a href="${pageContext.request.contextPath}/admin/news/news.jsp">
                            <i class="fa fa-circle-o"></i> 查看新闻
                        </a>
                    </li>
                    <security:authorize access="hasRole('ROLE_MANAGER')">
                    <li id="news-add">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('newsadd')">--%>
                        <a href="${pageContext.request.contextPath}/admin/news/newsadd.jsp" >
                            <i class="fa fa-circle-o"></i> 编辑新闻
                        </a>
                    </li>
                    <li id="news-modify">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('newsadmin')">--%>
                        <a href="${pageContext.request.contextPath}/admin/news/newsadmin.jsp">
                            <i class="fa fa-circle-o"></i> 管理新闻
                        </a>
                    </li>
                    </security:authorize>
                </ul>
            </li>



            <li class="treeview">
                <a href="#">
                    <i class="fa fa-rmb"></i> <span>财务管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li id="financial-manager">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('financial')">--%>
                        <a href="${pageContext.request.contextPath}/admin/financial/financial.jsp">
                            <i class="fa fa-circle-o"></i> 财务详情
                        </a>
                    </li>
                </ul>
            </li>



            <li class="treeview">
                <a href="#">
                    <i class="fa fa-street-view"></i> <span>人事管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li id="personnel-add">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('${pageContext.request.contextPath}/admin/wages')">--%>
                        <a href="${pageContext.request.contextPath}/admin/personnel/wages.jsp">
                            <i class="fa fa-circle-o"></i> 工资管理
                        </a>
                    </li>
                    <li id="personnel-attendance">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('${pageContext.request.contextPath}/admin/attendance')">--%>
                        <a href="${pageContext.request.contextPath}/admin/personnel/attendance.jsp">
                            <i class="fa fa-circle-o"></i> 考勤管理
                        </a>
                    </li>
                    <li id="personnel-welfare">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('${pageContext.request.contextPath}/admin/welfare')">--%>
                        <a href="${pageContext.request.contextPath}/admin/personnel/welfare.jsp">
                            <i class="fa fa-circle-o"></i> 奖金管理
                        </a>
                    </li>
                    <li id="personnel-modify">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('${pageContext.request.contextPath}/admin/person')">--%>
                        <a href="${pageContext.request.contextPath}/admin/personnel/person.jsp">
                            <i class="fa fa-circle-o"></i> 入职培训
                        </a>
                    </li>
                </ul>
            </li>



            <li class="treeview">
                <a href="#">
                    <i class="fa fa-bell"></i> <span>通知管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li id="notice-manager">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('notice')">--%>
                        <a href="${pageContext.request.contextPath}/admin/notice/notice.jsp">
                            <i class="fa fa-circle-o"></i> 通知详情
                        </a>
                    </li>
                    <%--<li id="notice-add">--%>
                        <%--&lt;%&ndash;<a href="javascript:void(0);" onclick="loadcontent('noticeadd')">&ndash;%&gt;--%>
                        <%--<a href="${pageContext.request.contextPath}/admin/notice/noticeadd.jsp">--%>
                            <%--<i class="fa fa-circle-o"></i> 新建通知--%>
                        <%--</a>--%>
                    <%--</li>--%>
                    <li id="notice-modify">
                        <%--<a href="javascript:void(0);" onclick="loadcontent('noticeadmin')">--%>
                        <a href="${pageContext.request.contextPath}/admin/notice/noticeadmin.jsp">
                            <i class="fa fa-circle-o"></i> 通知管理
                        </a>
                    </li>
                </ul>
            </li>

            <!-- 菜单 /-->

            <%--<li id="admin-documentation"><a href="documentation.html" target="_blank"><i class="fa fa-book"></i> <span>AdminLTE汉化文档</span></a></li>--%>

        </ul>
    </section>
    <!-- /.sidebar -->
</aside>
